Skip to content

LAMMPS: set $LD_PRELOAD for testing CUDA build without device present - #4190

Open
laraPPr wants to merge 5 commits into
easybuilders:developfrom
laraPPr:20260803104334_new_pr_lammps
Open

LAMMPS: set $LD_PRELOAD for testing CUDA build without device present#4190
laraPPr wants to merge 5 commits into
easybuilders:developfrom
laraPPr:20260803104334_new_pr_lammps

Conversation

@laraPPr

@laraPPr laraPPr commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

(created using eb --new-pr)

Comment thread easybuild/easyblocks/l/lammps.py Outdated
self.cfg['runtest'] = False

if self.cuda:
if not get_gpu_info():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With just checking get_gpu_info for any returned value, this branch might not get executed on a node with an AMD GPU.
Instead, we should check if any NVIDIA GPU is found.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait I don't see the issue with that emmediatly. It is first checking if it is build with CUDA. If an amd gpu is present it is still not gonna find the libcuda.so?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code sets LD_PRELOAD if CUDA is in the dependencies but no GPU is found.
If an NVIDIA GPU is present, libcuda.so likely exists due to the NVIDIA drivers.
If an AMD GPU is present but no NVIDIA GPU, LD_PRELOAD is not set and we'll fail the same way as for no GPU, which is tried to get fixed here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I don't have access to an AMD GPU so it will hard for me to test it. Would you use a CUDA installation on an AMD GPU? @casparvl would somebody at surf be interested into looking into this case?

@laraPPr laraPPr Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok for now to ignore AMD GPU's in this pr. Because this is also only a fix for the EESSI stack. When I'm crosscompiling on our local stack it is still failing during the build-step. I'm trying to track down the difference between the two enironments.

Comment thread easybuild/easyblocks/l/lammps.py Outdated
Co-authored-by: Jan André Reuter <jan@zyten.de>
@boegel boegel changed the title LAMMPS: set LD_PRELOAD for testing CUDA build without device present LAMMPS: set $LD_PRELOAD for testing CUDA build without device present Aug 26, 2026
@boegel boegel added the EESSI Related to EESSI project label Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix EESSI Related to EESSI project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants